<?php
/**
 * Core_Model_Maincategorydata
 * get all main categories data
 * @author Adrian Stolarski
 */
class Core_Model_Maincategorydata implements Core_Model_Mainable {
    
    /**
     *
     * @var type $action_handler
     * action handler
     */
    public $action_handler;
    
    /**
     * main()
     * get main categories data
     * 
     * @param array $variables
     * @return type category data
     */
    public function main(array $variables = null) {
        //var_dump($variables);
        //die();
        if(!is_null($variables) && isset($variables['sub_category_main_category_id'])){
            //var_dump($variables);
            //die();
            $this->action_handler = new Core_Data_Currentmaincategorydata;
            return $this->action_handler->main($variables);
        }
        else if(is_null($variables)){
            //var_dump($variables);
            //die();
           $this->action_handler = new Core_Data_Allmaincategoriesdata;
           return $this->action_handler->main($variables);
        }
        else {
            
        }
    }

}
